package com.littlebee.storysuper.activity;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.widget.ListView;

import com.littlebee.storysuper.R;
import com.littlebee.storysuper.adapter.CircleAdapter;
import com.littlebee.storysuper.entry.CircleEntry;
import com.zss.library.activity.BaseActivity;
import com.zss.library.toolbar.CommonToolbar;

import java.util.ArrayList;
import java.util.List;

public class PhotoActivity extends BaseActivity {
    private List<CircleEntry> mCircleBeans;
    private ListView mListView;
    private List<String> mImgList;
    @Override
    public int getLayoutResId() {
        return R.layout.activity_photo;
    }

    @Override
    public void initView() {
        super.initView();
        mListView = (ListView) findViewById(R.id.listview);
    }

    @Override
    public void initData(Bundle savedInstanceState) {
        super.initData(savedInstanceState);
        mImgList = new ArrayList<>();
        mImgList.add("http://imgsrc.baidu.com/forum/w%3D580/sign=7eb05e9eddf9d72a17641015e428282a/3e87194c510fd9f9b3d66fc8212dd42a2a34a4c9.jpg");
        mImgList.add("http://imgsrc.baidu.com/forum/w%3D580/sign=f09bb261cfbf6c81f7372ce08c3eb1d7/c213c895d143ad4bbd0a10c981025aafa40f06b6.jpg");
        mImgList.add("http://img5.ph.126.net/PpGsC74VUQWuERP1gdwKGQ==/580964351947981315.jpg");
        mImgList.add("http://img1.imgtn.bdimg.com/it/u=3749455878,661128293&fm=21&gp=0.jpg");
        mImgList.add("http://ww2.sinaimg.cn/mw600/a1957912gw1e8aj508g1mj20go0b40uh.jpg");
        mImgList.add("http://ww2.sinaimg.cn/large/83dcc5dbjw1dtpbjzipdaj.jpg");
        mImgList.add("http://p18.qhimg.com/t0144d6a0802f22be4f.jpg");
        mImgList.add("http://img2.3lian.com/2014/f5/158/d/90.jpg");
        mImgList.add("http://p18.qhimg.com/t0144d6a0802f22be4f.jpg");
        mImgList.add("http://img2.3lian.com/2014/f5/158/d/90.jpg");
        mCircleBeans = new ArrayList<>();
        CircleEntry bean1 = new CircleEntry();
        bean1.nickName = "今天";
        bean1.imgList = mImgList.subList(0,2);
        mCircleBeans.add(bean1);
        CircleEntry bean2 = new CircleEntry();
        bean2.nickName = "昨天";
        bean2.imgList = mImgList.subList(0,5);
        mCircleBeans.add(bean2);
        for (int i = 1; i < 30; i++) {
            CircleEntry bean = new CircleEntry();
            bean.nickName = "2017-8-" + i;
            bean.imgList = mImgList.subList(0,i%9+1);
            mCircleBeans.add(bean);
        }
        mListView.setAdapter(new CircleAdapter(mCircleBeans, this));
    }
    @Override
    public void setTopBar() {
        super.setTopBar();
        setStatusBarColor(R.color.module_video_bg);
        CommonToolbar toolbar = getToolbar();
        toolbar.setBgRes(R.color.module_video_bg);
        toolbar.setTitle(getString(R.string.boby_photo_txt));

    }
}
